#!/bin/bash

BASEDIR=/root/data

#"train":["TUD-Campus", "ETH-Sunnyday", "KITTI-17", "MOT16-04", "MOT16-05", "MOT16-09", "MOT16-10", "MOT16-11", "MOT16-13"],
#"validation":["TUD-Stadtmitte", "PETS09-S2L1", "ETH-Bahnhof", "KITTI-13", "MOT16-02"],
#"test":["TUD-Stadtmitte", "PETS09-S2L1", "ETH-Bahnhof", "KITTI-13", "MOT16-02"]

# home
#SRC_BASE_DIR=/data/ErisedData

# kasim
#SRC_BASE_DIR=/data/data

# erisdlab
SRC_BASE_DIR=/home/erisedlab/dev/data

# erised
#SRC_BASE_DIR=/data

MOT_PATH=${SRC_BASE_DIR}/MOT
TUD_Campus_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/TUD-Campus
ETH_Sunnyday_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/ETH-Sunnyday
KITTI_17_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/KITTI-17
TUD_Stadtmitte_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/TUD-Stadtmitte
PETS09_S2L1_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/PETS09-S2L1
ETH_Bahnhof_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/ETH-Bahnhof
KITTI_13_PATH=${SRC_BASE_DIR}/MOT/2DMOT2015/train/KITTI-13
MOT16_02_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-02
MOT16_04_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-04
MOT16_05_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-05
MOT16_09_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-09
MOT16_10_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-10
MOT16_11_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-11
MOT16_13_PATH=${SRC_BASE_DIR}/MOT/MOT16/train/MOT16-13

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ ! -d "${BASEDIR}" ];then
    mkdir -p ${BASEDIR}
fi

if [ -d "${MOT_PATH}" ];then
    if [ -h "${BASEDIR}/MOT" ];then
        rm -f ${BASEDIR}/MOT
    fi
    if [ ! -d "${BASEDIR}/MOT" ];then
        ln -s ${MOT_PATH} ${BASEDIR}/MOT
    fi
fi

if [ -d "${TUD_Campus_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/TUD-Campus" ];then
        rm -f ${BASEDIR}/MOT/TUD-Campus
    fi
    if [ ! -d "${BASEDIR}/MOT/TUD-Campus" ];then
        ln -s ${TUD_Campus_PATH} ${BASEDIR}/MOT/TUD-Campus
    fi
fi

if [ -d "${ETH_Sunnyday_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/ETH-Sunnyday" ];then
        rm -f ${BASEDIR}/MOT/ETH-Sunnyday
    fi
    if [ ! -d "${BASEDIR}/MOT/ETH-Sunnyday" ];then
        ln -s ${ETH_Sunnyday_PATH} ${BASEDIR}/MOT/ETH-Sunnyday
    fi
fi

if [ -d "${KITTI_13_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/KITTI-13" ];then
        rm -f ${BASEDIR}/MOT/KITTI-13
    fi
    if [ ! -d "${BASEDIR}/MOT/KITTI-13" ];then
        ln -s ${KITTI_13_PATH} ${BASEDIR}/MOT/KITTI-13
    fi
fi

if [ -d "${KITTI_17_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/KITTI-17" ];then
        rm -f ${BASEDIR}/MOT/KITTI-17
    fi
    if [ ! -d "${BASEDIR}/MOT/KITTI-17" ];then
        ln -s ${KITTI_17_PATH} ${BASEDIR}/MOT/KITTI-17
    fi
fi

if [ -d "${TUD_Stadtmitte_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/TUD-Stadtmitte" ];then
        rm -f ${BASEDIR}/MOT/TUD-Stadtmitte
    fi
    if [ ! -d "${BASEDIR}/MOT/TUD-Stadtmitte" ];then
        ln -s ${TUD_Stadtmitte_PATH} ${BASEDIR}/MOT/TUD-Stadtmitte
    fi
fi

if [ -d "${PETS09_S2L1_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/PETS09-S2L1" ];then
        rm -f ${BASEDIR}/MOT/PETS09-S2L1
    fi
    if [ ! -d "${BASEDIR}/MOT/PETS09-S2L1" ];then
        ln -s ${PETS09_S2L1_PATH} ${BASEDIR}/MOT/PETS09-S2L1
    fi
fi

if [ -d "${ETH_Bahnhof_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/ETH-Bahnhof" ];then
        rm -f ${BASEDIR}/MOT/ETH-Bahnhof
    fi
    if [ ! -d "${BASEDIR}/MOT/ETH-Bahnhof" ];then
        ln -s ${ETH_Bahnhof_PATH} ${BASEDIR}/MOT/ETH-Bahnhof
    fi
fi

if [ -d "${MOT16_02_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-02" ];then
        rm -f ${BASEDIR}/MOT/MOT16-02
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-02" ];then
        ln -s ${MOT16_02_PATH} ${BASEDIR}/MOT/MOT16-02
    fi
fi

if [ -d "${MOT16_04_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-04" ];then
        rm -f ${BASEDIR}/MOT/MOT16-04
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-04" ];then
        ln -s ${MOT16_04_PATH} ${BASEDIR}/MOT/MOT16-04
    fi
fi

if [ -d "${MOT16_05_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-05" ];then
        rm -f ${BASEDIR}/MOT/MOT16-05
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-05" ];then
        ln -s ${MOT16_05_PATH} ${BASEDIR}/MOT/MOT16-05
    fi
fi

if [ -d "${MOT16_09_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-09" ];then
        rm -f ${BASEDIR}/MOT/MOT16-09
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-09" ];then
        ln -s ${MOT16_09_PATH} ${BASEDIR}/MOT/MOT16-09
    fi
fi

if [ -d "${MOT16_10_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-10" ];then
        rm -f ${BASEDIR}/MOT/MOT16-10
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-10" ];then
        ln -s ${MOT16_10_PATH} ${BASEDIR}/MOT/MOT16-10
    fi
fi

if [ -d "${MOT16_11_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-11" ];then
        rm -f ${BASEDIR}/MOT/MOT16-11
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-11" ];then
        ln -s ${MOT16_11_PATH} ${BASEDIR}/MOT/MOT16-11
    fi
fi

if [ -d "${MOT16_13_PATH}" ];then
    if [ -h "${BASEDIR}/MOT/MOT16-13" ];then
        rm -f ${BASEDIR}/MOT/MOT16-13
    fi
    if [ ! -d "${BASEDIR}/MOT/MOT16-13" ];then
        ln -s ${MOT16_13_PATH} ${BASEDIR}/MOT/MOT16-13
    fi
fi


cd $CUR_DIR
